<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Search For User</title>
    </h:head>
    <h:body>
        <ui:composition template="/Template/newTemplate.xhtml">
        <ui:define name="content">
            <h:form>
                <h:outputText value="Search"/>
                <h:inputText value="#{testBean.search}">
                </h:inputText>
                <h:commandButton value="AJAX" > 
                    <f:ajax execute="@form" render="result"/> 
                </h:commandButton>
                <h:dataTable value="#{testBean.users}" var="t" id="result">
                    <h:column>
                        <f:facet name="header">
                            Username
                        </f:facet>
                        <h:commandLink action="userPage" value="#{t.username}">
                            <f:setPropertyActionListener target="#{displayUserBean.id}" value="#{t.id}"/>
                        </h:commandLink>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            Country
                        </f:facet>
                        #{t.country}
                    </h:column>
                </h:dataTable>
            </h:form>
        </ui:define>
        </ui:composition>
    </h:body>
</html>

